﻿using System;
using System.Linq;

namespace VASJ.Common
{
    public class FileNameAttribute : Attribute
    {
        public string Name { get; set; }

        public static FileNameAttribute GetFileName<T>()
        {
            Type objectType = typeof(T);

            object[] attributes = objectType.GetCustomAttributes(false);

            return (FileNameAttribute)attributes.FirstOrDefault(attr => attr is FileNameAttribute);
        }
    }
}